﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace MuaBanLike.com
{
    public enum ServiceAction
    {
        NONE = 1,
        LIKE,
        FOLLOW,
        SHARE,
        GOOGLEPLUS,
        SURF
    };

    public partial class MainWindow : Window
    {
       

        private bool m_bChageAccount = false;
        
        public ServiceAction m_serviceActive = ServiceAction.NONE; // Default

        Uri m_mainWeb = null;
        
        Uri m_LikeFacebook = null;
        Uri m_FollowFacebook = null;
        Uri m_ShareFacebook = null;
        Uri m_googlePlus = null;
        Uri m_trafficExchange = null;


        public void HideScriptErrors(System.Windows.Controls.WebBrowser wb, bool hide)
        {
            var fiComWebBrowser = typeof(System.Windows.Controls.WebBrowser).GetField("_axIWebBrowser2", BindingFlags.Instance | BindingFlags.NonPublic);
            if (fiComWebBrowser == null) return;
            var objComWebBrowser = fiComWebBrowser.GetValue(wb);
            if (objComWebBrowser == null)
            {
                wb.Loaded += (o, s) => HideScriptErrors(wb, hide); //In case we are to early
                return;
            }
            objComWebBrowser.GetType().InvokeMember("Silent", BindingFlags.SetProperty, null, objComWebBrowser, new object[] { hide });
        }

        

        public void showBallon(string title, string msg)
        {
            //ni.BalloonTipText = msg;
            //ni.BalloonTipTitle = title;
            //ni.ShowBalloonTip(500);
        }

    }
}
